
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form prependId="false">
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['button.save']}" action="#{tbAgendaEditMB.insert}"
						rendered="#{!tbAgendaEditMB.updateMode}" ajax="false"/>
						
					<p:commandButton value="#{messages['button.save']}" action="#{tbAgendaEditMB.update}"
						rendered="#{tbAgendaEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.delete']}" onclick="confirmation.show()"
						rendered="#{tbAgendaEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.delete']}" severity="alert" widgetVar="confirmation">
						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{tbAgendaEditMB.delete}" immediate="true"
							ajax="false" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>

			<br />

			<p:fieldset legend="#{messages['tbAgenda.label']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid id="fields" columns="2">
				
					
					<p:outputLabel value="#{messages['tbAgenda.label.idCliente']}: " for="idCliente" styleClass="text-input" />
					<p:selectOneMenu id="idCliente" value="#{tbAgendaEditMB.bean.tbCliente}" converter="tbClienteConverter" required="true" requiredMessage="#{messages['mensagem.campo.null']}">
						<f:selectItems value="#{tbAgendaEditMB.tbClientes}"/>
					</p:selectOneMenu>
					
					<p:outputLabel value="#{messages['tbAgenda.label.idServico']}: " for="idServico" styleClass="text-input" />
					<p:selectOneMenu id="idServico" value="#{tbAgendaEditMB.bean.tbServico}" converter="tbServicoConverter" required="true" requiredMessage="#{messages['mensagem.campo.null']}">
						<f:selectItems value="#{tbAgendaEditMB.tbServicos}"/>
					</p:selectOneMenu>
					
					<p:outputLabel value="#{messages['tbAgenda.label.dtAgendamento']}: " for="dtAgendamento" styleClass="text-input" />
					<p:calendar id="dtAgendamento" value="#{tbAgendaEditMB.bean.dtAgendamento}" pattern="dd/MM/yyyy" locale="pt_BR" 
						title="#{messages['tbAgenda.alt.dtAgendamento']}" required="true" requiredMessage="#{messages['mensagem.campo.null']}"/>
					   
					<p:outputLabel value="#{messages['tbAgenda.label.hrAgendamento']}: " for="hrAgendamento" styleClass="text-input" />
					<p:calendar id="hrAgendamento" value="#{tbAgendaEditMB.bean.hrAgendamento}" pattern="HH:mm" timeOnly="true"  locale="pt_BR"
						title="#{messages['tbAgenda.alt.hrAgendamento']}" required="true" requiredMessage="#{messages['mensagem.campo.null']}"/>
					
					<p:outputLabel value="#{messages['tbFuncionario.label.idFuncionario']}: " for="idFuncionario" styleClass="text-input" />
					<p:selectOneMenu id="idFuncionario" value="#{tbAgendaEditMB.bean.tbFuncionario}" converter="tbFuncionarioConverter" required="true" requiredMessage="#{messages['mensagem.campo.null']}">
						<f:selectItems value="#{tbAgendaEditMB.tbFuncionarios}"/>
					</p:selectOneMenu>
					   
				</h:panelGrid>
			</p:fieldset>
		</h:form>
	</ui:define>
</ui:composition>